/**
 * meta.title 菜单标题 不设置则不会显示在菜单栏中
 * meta.icon 菜单图标
 * meta.layout false 路由不会配置到layout的main中,即整个窗口显示
 * meta.permission 配置路由权限名称
 * meta.hideInMenu: true 则不会显示在菜单栏
 * meta.keepAlive 是否缓存(若需缓存,name必须且keepAlive为true)
 * 中间层路由使用 {render: (h) => h("router-view")}
 */

export default [
  {
    path: '/login',
    meta: { title: '登录', layout: false, hideInMenu: true },
    name: 'Login',
    component: () => import('@/views/login/Index.vue'),
  },
  {
    path: '/community',
    meta: { title: '小区管理', permission: 'Community' },
    name: 'Community',
    component: () => import('@/views/community/Index.vue'),
  },
  {
    path: '/garage/:cId',
    meta: { title: '车库管理', hideInMenu: true, parentKey: '/community' },
    name: 'Garage',
    component: () => import('@/views/garage/Index.vue'),
  },
  {
    path: '/parking',
    meta: { title: '车位管理', permission: 'Parking' },
    name: 'Parking',
    component: () => import('@/views/parking/Index.vue'),
  },
  {
    path: '/parking-share/:spaceId',
    meta: { title: '车位分享', hideInMenu: true, parentKey: '/parking' },
    name: 'ParkingShare',
    component: () => import('@/views/share/Index.vue'),
  },
  {
    path: '/order',
    meta: { title: '订单管理', permission: 'Order' },
    name: 'Order',
    component: () => import('@/views/order/Index.vue'),
  },
  {
    path: '/reservation',
    meta: { title: '临停预约管理', permission: 'Reservation' },
    name: 'Reservation',
    component: () => import('@/views/reservation/Index.vue'),
  },
  {
    path: '/owner',
    meta: { title: '业主管理', permission: ['Settled', 'Owners'] },
    name: 'Owner',
    render: (h) => h('router-view'),
    children: [
      {
        path: '/owner/settled',
        meta: { title: '入驻申请', permission: 'Settled' },
        name: 'Settled',
        component: () => import('@/views/settled/Index.vue'),
      },
      {
        path: '/owner/owners',
        meta: { title: '业主信息', permission: 'Owners' },
        name: 'Owners',
        component: () => import('@/views/owners/Index.vue'),
      },
      {
        path: '/owner-parking/:oId',
        meta: { title: '业主车位', hideInMenu: true, parentKey: '/owner/owners' },
        name: 'OwnerParking',
        component: () => import('@/views/owners/Parking.vue'),
      },
      {
        path: '/owner-share/:oId',
        meta: { title: '车位分享', hideInMenu: true, parentKey: '/owner/owners' },
        name: 'OwnerShare',
        component: () => import('@/views/ownersShare/Index.vue'),
      },
    ],
  },
  {
    path: '/marketing',
    meta: { title: '营销管理', permission: ['Activity', 'Prize', 'Reward'] },
    name: 'Marketing',
    render: (h) => h('router-view'),
    children: [
      {
        path: '/marketing/activity',
        meta: { title: '活动管理', permission: 'Activity' },
        name: 'Activity',
        component: () => import('@/views/activity/Index.vue'),
      },
      {
        path: '/marketing/prize',
        meta: { title: '中奖管理', permission: 'Prize' },
        name: 'Prize',
        component: () => import('@/views/prize/Index.vue'),
      },
      {
        path: '/marketing/reward',
        meta: { title: '奖品管理', permission: 'Reward' },
        name: 'Reward',
        component: () => import('@/views/reward/Index.vue'),
      },
    ],
  },
  {
    path: '/news',
    meta: { title: '资讯管理', permission: 'News' },
    name: 'News',
    component: () => import('@/views/news/Index.vue'),
  },

  {
    path: '/sales',
    meta: { title: '销售管理', permission: ['Business', 'Evaluate'] },
    name: 'Sales',
    render: (h) => h('router-view'),
    children: [
      {
        path: '/sales/business',
        meta: { title: '询价商机', permission: 'Business' },
        name: 'Business',
        component: () => import('@/views/business/Index.vue'),
      },
      {
        path: '/sales/evaluate',
        meta: { title: '评价管理', permission: 'Evaluate' },
        name: 'Evaluate',
        component: () => import('@/views/evaluate/Index.vue'),
      },
    ],
  },
  {
    path: '/adviser',
    meta: { title: '人员管理', permission: 'User' },
    name: 'Adviser',
    component: () => import('@/views/adviser/Index.vue'),
  },
]
